package cn.ml.sheJiMoShi.single.eHan;
/*
 *最简单的恶汉单例模式(可能浪费内存)
 */
public class HungrySingleton {

    private byte[] data1 = new byte[1024*1024];
    private byte[] data2 = new byte[1024*1024];
    private byte[] data3 = new byte[1024*1024];
    private byte[] data4 = new byte[1024*1024];


    //类加载时就创建这个实例对象
    private static final HungrySingleton hungrySingleton = new HungrySingleton();
    //私有化构造函数
    private HungrySingleton(){}
    //提供全局访问点
    public static HungrySingleton getInstance(){
        return hungrySingleton;
    }


}
